<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <style>
        input {
            color: #999;
        }
    </style>
</head>

<body>
    <input type="text" name="" value="手机" id="">

    <script>

        var text = document.querySelector('input')

        text.onfocus = function () {
            if (this.value === '手机') {
                this.value = ''
            }
            this.style.color='#333'

        }
        text.onblur = function () {
            if (this.value === '') {
                this.value = '手机';

            }
            this.style.color='#999'


        }

    </script>
</body>

</html>